#define _CRT_SECURE_NO_WARNINGS 1
#include"ObjectPool.h"
#include "ConcurrentAlloc.h"

void Alloc1()
{
	for (size_t i = 0; i < 5; i++)
	{
		void* ptr = ConcurrentAlloc(6);
	}
}
void Alloc2()
{
	for (size_t i = 0; i < 5; i++)
	{
		void* ptr = ConcurrentAlloc(7);
	}
}
void TLStest()
{
	std::thread t1(Alloc1);
	std::thread t2(Alloc2);

	t1.join();
	t2.join();
}
void ConcurrentAllocTest1()
{
	void* p1 = ConcurrentAlloc(5);
	void* p2 = ConcurrentAlloc(8);
	void* p3 = ConcurrentAlloc(3);
	void* p4 = ConcurrentAlloc(7);
	cout << p1 << endl;
	cout << p2 << endl;
	cout << p3 << endl;
	cout << p4 << endl;
}
int main()
{
	//TestObjectPool();
	//TLStest();
	ConcurrentAllocTest1();
	return 0;
}